class Range {
  constructor(start, end) {
    this.start = start;
    this.end = end;
  }
  *[Symbol.iterator]() {
    for (let i = Math.ceil(this.start); i <= this.end; i += 1) yield i;
  }
}

console.log([...new Range(-1.3, 3.5)]); // [ -1, 0, 1, 2, 3 ]
for (const v of new Range(0.2, 3)) console.log(v); // 1 2 3
